#ifndef MESSAGEEDITAREA_H
#define MESSAGEEDITAREA_H

#include <QWidget>
#include <QPushButton>
#include <QPlainTextEdit>

namespace model {
    enum MessageType;
    class Message;
}

class MessageEditArea : public QWidget
{
    Q_OBJECT
public:
    explicit MessageEditArea(QWidget* parent = nullptr);

    QPushButton* getSendBtn();

private:
    void initSignalSlot();

    void sendTextMessage();

    void addSelfMessage(model::MessageType messageType, const QByteArray& content, const QString& extraInfo);

    void addOtherMessage(const model::Message& message);

    void onClickedSendImageBtn();

    void onClickedSendFileBtn();

    void onPressedSendSpeechBtn();

    void onReleasedSendSpeechBtn();

    void speechRecordDoneHandle(const QString& path);

private:
    QPlainTextEdit* textEdit;
    QPushButton* sendBtn;
    QPushButton* sendImageBtn;
    QPushButton* sendFileBtn;
    QPushButton* sendSpeechBtn;
    QPushButton* showHistoryBtn;
    
signals:
};

#endif // MESSAGEEDITAREA_H
